package com.hx.zhg.util;

/**
 * Created by zhenghegong on 2018/1/18.
 */
public class ArithUtil {

    private static int key = 64;

    /** 用户ID的加密  **/
    public static int userIdEncode(int userId){
        int encode = ((userId << 4) ^ key) << 2;
        return encode;
    }

    /** 用户ID的加密 返回USERID  **/
    public static int userIdDecode(int encode_userid){
        int decode_userid = ((encode_userid >> 2) ^ key) >> 4;
        return decode_userid;
    }

    public static void main(String[] args) {
        int i = userIdDecode(11240832);
        System.out.println(i);
    }

}
